//
//  BEMyOrderCell.swift
//  BEGlobalOiler
//
//  Created by KKING on 16/8/30.
//  Copyright © 2016年 Bullseye Energy pte ltd. All rights reserved.
//

import UIKit
import SnapKit

class BEOrderTableCell: UITableViewCell {
    
    @IBOutlet weak var backImg: UIImageView!
    
    @IBOutlet weak var orderStatusTF: UILabel!
    @IBOutlet weak var performLbl: UILabel!
    
    @IBOutlet weak var rigNameTF: UILabel!
    @IBOutlet weak var rigLocationTF: UILabel!
    @IBOutlet weak var createTimeTF: UILabel!
    @IBOutlet weak var techNameTF: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        backImg.contentMode = .scaleToFill
    }
    
    
    
    
    var ordersViewModel: BEMyOrdersViewModel? {
        didSet{
            orderStatusTF.text = ordersViewModel?.orderStatusName
            rigNameTF.text = ordersViewModel?.rigName
            rigLocationTF.text = ordersViewModel?.rigLocation
            createTimeTF.text = ordersViewModel?.createTime
            
            if ordersViewModel?.talentNames?.characters.count != nil {
                techNameTF.text = ordersViewModel?.talentNames
                techNameTF.textColor = UIColor.blue
                techNameTF.alpha = 0.8
                performLbl.isHidden = false
            }else{
                performLbl.isHidden = true
                techNameTF.text = "unAssigned"
                techNameTF.textColor = UIColor.darkGray
            }
        }
    }
    
}
